﻿using System;
using System.Diagnostics;

namespace FootSteps.Domain.Loggers.Window
{
    public class OpenWindowTitle
    {
        public IntPtr Handle { get; private set; }
        public string Title { get; private set; }
        public Process Process { get; private set; }

        public OpenWindowTitle(IntPtr handle, string windowTitle, Process process)
        {
            Handle = handle;
            Title = windowTitle;
            Process = process;
        }

        public override string ToString()
        {
            string pName;
            try
            {
                pName = Process.ProcessName;
            }
            catch (Exception)
            {
                pName = "";
            }
            return pName + ": " + Title;
        }

    }
}